package com.jt.controller;

import com.jt.vo.ImageVO;
import net.sf.jsqlparser.schema.MultiPartName;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;

public class FileController {

    //public String file(MultiPartFile fileImage){

    //}

    /**
     * 业务实现: 文件上传实现
     * URL地址:   http://localhost:8091/pic/upload?dir=image
     * 参数:      uploadFile
     * 返回值:    ImageVO
     */
    @RequestMapping("/pic/upload")
    public ImageVO uploadFile(MultipartFile uploadFile){

        return fileService.uploadFile(uploadFile);
       /* String url = "https://img14.360buyimg.com/n0/jfs/t1/151857/40/2398/38943/5f8842b9Edac7df98/0a8a77bfea24aa1d.jpg";
        return ImageVO.success(url, 800, 800);*/
    }
}
